using UnityEngine;

public class ChangeTextureByAspect : MonoBehaviour
{
	public Texture tex16_9;

	public Texture tex4_3;

	public UIRoot root;

	public UITexture background;

	private void Awake()
	{
		int num;
		int num2;
		if (Screen.width > Screen.height)
		{
			num = Screen.width;
			num2 = Screen.height;
		}
		else
		{
			num = Screen.height;
			num2 = Screen.width;
		}
		if ((double)((float)num / (float)num2) < 1.45)
		{
			background.mainTexture = tex4_3;
		}
		else
		{
			background.mainTexture = tex16_9;
		}
		root.manualWidth = num;
		root.manualHeight = num2;
		background.height = num2;
		background.width = num;
	}
}
